/*
 * @Description: 国际化设置
 * @Author: wangfuwei
 * @Date: 2020-11-30 19:02:07
 * @LastEditors: wangfuwei
 * @LastEditTime: 2021-04-23 21:35:26
 * @FilePath: /horizon-frontend/src/locales/index.js
 */
import Vue from "vue";
import VueI18n from "vue-i18n";
import zhCN from "./lang/zh-CN";
import enUS from "./lang/en-US";
import { getLanguage } from "./util";
import { DEFAULT_LANGUAGE } from "@/core/const";

Vue.use(VueI18n);

const i18n = new VueI18n({
  locale: getLanguage(),
  messages: {
    "zh-CN": { ...zhCN },
    "en-US": { ...enUS },
  },
  fallbackLocale: DEFAULT_LANGUAGE,
  silentTranslationWarn: true,
});

export default i18n;
